package com.webware.view.client;

import com.google.gwt.place.shared.PlaceController;
import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;
import com.webware.view.client.ui.HeaderView;
import com.webware.view.client.ui.HeaderViewImpl;
import com.webware.view.client.ui.StartView;
import com.webware.view.client.ui.StartViewImpl;

public class ClientFactoryImpl implements ClientFactory {
    private static final EventBus eventBus = new SimpleEventBus();
    private static final PlaceController placeController = new PlaceController(
	    eventBus);
    private static StartView startView = null;
    private static HeaderView headerView = null;

    public EventBus getEventBus() {
	return eventBus;
    }

    public PlaceController getPlaceController() {
	return placeController;
    }

    public StartView getStartView() {
	if (startView == null)
	    startView = new StartViewImpl();
	return startView;
    }

    public HeaderView getHeaderView() {
	if (headerView == null)
	    headerView = new HeaderViewImpl();
	return headerView;
    }
}
